package com.jwsoft.manager.core.gateway.controller;

import com.bifang.assistant.common.constants.Validators;
import com.bifang.engine.assistant.core.domain.AppResponse;
import com.bifang.engine.protect.core.annotation.Idempotent;
import com.github.pagehelper.PageInfo;
import com.jwsoft.manager.common.vo.eduBigscreenZbtj02.EduBigscreenZbtj02KeyVO;
import com.jwsoft.manager.common.vo.eduBigscreenZbtj02.EduBigscreenZbtj02QueryVO;
import com.jwsoft.manager.common.vo.eduBigscreenZbtj02.EduBigscreenZbtj02VO;
import com.jwsoft.manager.core.integration.EduBigscreenZbtj02Integration;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 新生报名大屏指标统计02(区域学校学位排名)网关
 *
 * @author linyh
 * @since 2023-04-23
 */
@RestController
@RequestMapping(value = "/doc/api")
@Tag(name = "新生报名大屏指标统计02(区域学校学位排名)", description = "新生报名大屏指标统计02(区域学校学位排名)")
public class EduBigscreenZbtj02Controller {

    @Autowired
    public EduBigscreenZbtj02Integration eduBigscreenZbtj02Integration;

    @Operation(summary = "新生报名大屏指标统计02(区域学校学位排名)分页查询",description = "新生报名大屏指标统计02(区域学校学位排名)分页查询")
    @PostMapping(value = "/eduBigscreenZbtj020001", produces = "application/json;charset=UTF-8")
    public AppResponse<PageInfo<EduBigscreenZbtj02VO>> getList(@RequestBody @Validated EduBigscreenZbtj02QueryVO vo) {
        return AppResponse.successData(eduBigscreenZbtj02Integration.getList(vo));
    }

    @Operation(summary = "新生报名大屏指标统计02(区域学校学位排名)根据主键查询详情",description = "新生报名大屏指标统计02(区域学校学位排名)根据主键查询详情")
    @PostMapping(value = "/eduBigscreenZbtj020002", produces = "application/json;charset=UTF-8")
    public AppResponse<EduBigscreenZbtj02VO> getById(@RequestBody @Validated EduBigscreenZbtj02KeyVO vo) {
        return AppResponse.successData(eduBigscreenZbtj02Integration.getById(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "新生报名大屏指标统计02(区域学校学位排名)新增",description = "新生报名大屏指标统计02(区域学校学位排名)新增")
    @PostMapping(value = "/eduBigscreenZbtj020004", produces = "application/json;charset=UTF-8")
    public AppResponse<EduBigscreenZbtj02VO> add(@RequestBody @Validated(value = {Validators.Add.class}) EduBigscreenZbtj02VO vo) {
        return AppResponse.successData(eduBigscreenZbtj02Integration.add(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "新生报名大屏指标统计02(区域学校学位排名)修改",description = "新生报名大屏指标统计02(区域学校学位排名)修改")
    @PostMapping(value = "/eduBigscreenZbtj020005", produces = "application/json;charset=UTF-8")
    public AppResponse<EduBigscreenZbtj02VO> edit(@RequestBody @Validated(value = {Validators.Edit.class}) EduBigscreenZbtj02VO vo) {
        return AppResponse.successData(eduBigscreenZbtj02Integration.edit(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "新生报名大屏指标统计02(区域学校学位排名)删除",description = "新生报名大屏指标统计02(区域学校学位排名)删除")
    @PostMapping(value = "/eduBigscreenZbtj020006", produces = "application/json;charset=UTF-8")
    public AppResponse del(@RequestBody @Validated EduBigscreenZbtj02KeyVO vo) {
        eduBigscreenZbtj02Integration.del(vo);
        return AppResponse.successMsg("删除成功！");
    }
}
